package plataforma.cih.campos;

import org.hibernate.criterion.Order;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventListener;
import org.zkoss.zul.Button;

import plataforma.crud.cih.PainelPesquisa;

public abstract class PainelFiltroBandBox extends PainelPesquisa {

	private static final long serialVersionUID = -2287302294092712528L;

	CampoDropDownAvancado componenteDropDown;

	@Override
	public void definirListener(Button botaoFiltra) {
		EventoPesquisar el = new EventoPesquisar();
		botaoFiltra.addEventListener("onClick", el);

	}

	public abstract void preencherCriterios();

	public CampoDropDownAvancado getComponenteDropDown() {
		return componenteDropDown;
	}

	public void setComponenteDropDown(CampoDropDownAvancado componenteDropDown) {
		this.componenteDropDown = componenteDropDown;
	}

	public void filtrar() {
		preencherCriterios();
		componenteDropDown.acaoPesquisar();
	}

	public final class EventoPesquisar implements EventListener {

		public void onEvent(Event event) throws Exception {

			filtrar();

		}

	}

	public abstract Order getCriterioOrdenacao();

	public abstract void definirParametrosIniciais();

	public abstract void montarGridParametros() ;

}
